Addhe Warman
·Follow
5 min read·Sep 30, 2023--
Introduction:Linux is at the heart of countless servers, data centers, and embedded systems, making it one of the most prevalent operating systems in the world. If you’re an aspiring or seasoned Linux administrator, you’ll rely on many commands to effectively manage and maintain Linux systems. This comprehensive guide will dive into 190 essential Linux commands that every Linux administrator should know. Whether you’re a beginner looking to build a strong foundation or an experienced admin seeking to expand your skill set, this resource has you covered.
Note: It’s impossible to cover every Linux command in one article, but we’ve curated a diverse list of essential commands that cover various aspects of Linux administration.
Navigation and File Management (20 Commands)ls: List files and directories.cd: Change directories.pwd: Print working directory.mkdir: Create directories.rmdir: Remove directories.touch: Create empty files.cp: Copy files and directories.mv: Move or rename files and directories.rm: Remove files.find: Search for files and directories.which: Locate a command.cat: Concatenate and display file content.more / less: Paginate file content.head / tail: Display the beginning or end of a file.ln: Create symbolic or hard links.stat: Display file or filesystem status.du: Estimate file and directory space usage.df: Report filesystem disk space usage.tree: Display directory tree structure.ncdu: A disk usage analyzer with a text-based interface.User and Group Management (15 Commands)useradd: Add a user account.userdel: Delete a user account.passwd: Change user passwords.groupadd: Add a group.groupdel: Delete a group.usermod: Modify user properties.groupmod: Modify group properties.su: Switch user.sudo: Execute commands as another user.who: Show who is logged on.w: Display who is logged in and what they are doing.id: Display user and group IDs.chown: Change file and directory ownership.chgrp: Change file and directory group ownership.newgrp: Start a new group with another group identity.System Information and Monitoring (15 Commands)uname: Display system information.hostname: Show or set system hostname.uptime: Display system uptime.top: Monitor system processes.htop: Interactive process viewer.ps: List running processes.kill: Terminate processes.free: Display memory usage.vmstat: Virtual memory statistics.iostat: Input/output statistics.netstat: Network statistics.ifconfig: Configure network interfaces.lspci: List PCI devices.lsusb: List USB devices.lsblk: List block devices.Package Management (10 Commands)apt: Advanced Package Tool (Debian/Ubuntu).dnf: Dandified YUM (Fedora/RHEL).yum: Yellowdog Updater Modified (RHEL/CentOS).zypper: OpenSUSE package manager.rpm: RPM Package Manager (query and verify).dpkg: Debian package manager.yumdownloader: Download RPM packages.dpkg-deb: Manipulate Debian packages.apt-get: Debian-based package manager.dnf install: Install packages (Fedora/RHEL).File Permissions and Ownership (10 Commands)chmod: Change file permissions.chown: Change file ownership.chgrp: Change group ownership.ls -l: Display detailed file information.umask: Set default file permissions.setfacl: Set file access control lists.getfacl: Get file access control lists.passwd -l: Lock a user account.passwd -u: Unlock a user account.visudo: Edit the sudoers file safely.Disk Management (10 Commands)fdisk: Partition table manipulator.gdisk: GPT fdisk.parted: Disk partitioning tool.mkfs: Create filesystems.mount: Mount filesystems.umount: Unmount filesystems.df: Disk space usage.du: Estimate disk usage.smartctl: Control and monitor storage systems.fsck: Filesystem consistency check.Process Management (10 Commands)ps: List processes.top: Dynamic process viewer.kill: Terminate processes.htop: Interactive process viewer.pgrep: List processes by name.pkill: Signal processes based on name.nice: Change process priority.renice: Alter process priority.at: Schedule tasks.cron: Schedule recurring tasks.Networking (15 Commands)ifconfig: Configure network interfaces.ip: Advanced IP configuration.ping: Send ICMP echo requests.traceroute: Trace network routes.netstat: Network statistics.ss: Socket statistics.telnet: Telnet client.ssh: Secure shell client.scp: Securely copy files.wget: Retrieve files from the web.curl: Transfer data with URLs.nslookup: Query DNS records.host: DNS lookup utility.dig: DNS information groper.nc: Network utility (Netcat).System and Service Management (15 Commands)systemctl: Systemd control manager.service: Init script service manager.chkconfig: Configure system services.ps aux: List all processes.journalctl: Query systemd logs.dmesg: Display kernel ring buffer.shutdown: Shutdown or restart the system.reboot: Reboot the system.hostnamectl: Control system hostname.timedatectl: Control system time and date.locale: Set system locale.lsb_release: Display distribution info.ufw: Uncomplicated Firewall.iptables: IP packet filter administration.sysctl: System control parameters.File Compression and Archiving (10 Commands)tar: Archive files.gzip: Compress files.gunzip: Decompress files.bzip2: Compress files (bzip2).bunzip2: Decompress files (bzip2).zip: Package and compress files (zip).unzip: Extract files from zip archives.rar: Create and extract RAR archives.7z: Create and extract 7z archives.xz: Compress files (xz).Text Processing (10 Commands)cat: Concatenate and display file content.grep: Search text using patterns.sed: Stream editor.awk: Text processing tool.cut: Remove sections from lines of files.sort: Sort lines in text files.uniq: Remove duplicates from sorted files.head / tail: Display the beginning or end of a file.wc: Word, line, character, and byte count.tee: Redirect output to multiple files.Disk and Filesystem Monitoring (10 Commands)iotop: Monitor I/O usage.iostat: Input/output statistics.df: Disk space usage.du: Estimate disk usage.lsof: List open files.fuser: Identify processes using files.watch: Execute commands repeatedly.inotifywait: Monitor file system events.sync: Synchronize cached writes to disk.hdparm: Get/set hard disk parameters.System Information Gathering (10 Commands)lscpu: Display CPU information.lsblk: List block devices.lshw: List hardware details.lspci: List PCI devices.lsusb: List USB devices.dmidecode: Display hardware information.uname: Display system information.free: Display memory usage.fdisk -l: List disk partitions.lsmod: List loaded kernel modules.File Editing (10 Commands)nano: Text editor for the terminal.vim: Powerful text editor.vi: Classic text editor.ed: Line-oriented text editor.sed: Stream editor.awk: Text processing tool.grep: Search text using patterns.cut: Remove sections from lines of files.tr: Translate characters.echo: Display messages.Backup and Restore (10 Commands)tar: Archive files.rsync: Remote file and directory sync.dd: Convert and copy files.cp: Copy files and directories.mv: Move or rename files and directories.find: Search for files and directories.locate: Find files by name.grep: Search text using patterns.cron: Schedule recurring tasks.at: Schedule tasks.Security (10 Commands)passwd: Change user passwords.sudo: Execute commands as another user.chmod: Change file permissions.chown: Change file ownership.chgrp: Change group ownership.ufw: Uncomplicated Firewall.iptables: IP packet filter administration.ssh-keygen: Generate SSH keys.gpg: GNU Privacy Guard for encryption.openssl: OpenSSL toolkit for security tasks.Conclusion:Becoming a proficient Linux administrator requires mastering a diverse set of commands. The 190 commands presented in this guide are essential for managing Linux systems, from basic file manipulation to advanced network and security tasks. As you gain experience and tackle different challenges, these commands will become invaluable tools in your Linux administration toolbox. Keep exploring, learning, and honing your Linux skills to become a proficient and efficient Linux administrator. Happy Linux administration!